﻿<style>
label{
	float:left;
	display:block;
	padding-top:8px;
}
fieldset label{
	padding-top:0px;
}
</style>
<form class="area">
	<h1>Novi cenovnik</h1>
	<label for="datum_start">Datum:</label><input type="text" name="datum_start" id="datum_start" rule="^\d{1,2}\.\d{1,2}\.\d{4}$" />
	<img class="datePicker" onclick="displayDatePicker('datum_start',this)" title="Odaberi datum" src="gui/icon_datepicker.gif" /><br clear="all" />
	<!-- ARTIKLI -->
	<input type="button" name="add" value="dodaj artikl" onclick="duplicateObject('fieldset',this.parentNode)" /><br clear="all"/>
	<fieldset id="1">
	  <legend><input onclick="if(confirm('Da li da obrišem artikl '+this.parentNode.id)){this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode)}" type="button" value="-" class="add" style="float:none;" /></legend>
		<label>
			Naziv artikla:<br />
			<select name="1_artikl" id="1_artikl">
				{{%loop start art_id}}
				<option value="{{$art_id}}">{{$art_name}}</option>
				{{%loop end}}
			</select>
		</label>
		<label>
			Tip artikla:<br />
			<select name="1_arttip" id="1_arttip">
				{{%loop start arttip_id}}
				<option value="{{$arttip_id}}">{{$arttip_name}}</option>
				{{%loop end}}
			</select>
		</label>
		<label>
			Boja:<br />
			<select name="1_artboja" id="1_artboja">
				{{%loop start artboja_id}}
				<option value="{{$artboja_id}}" title="{{$artboja_name}}">{{$artboja_code}}</option>
				{{%loop end}}
			</select>
		</label>
		<input type="button" id="save_btn" value="Sačuvaj polje" />
		<br clear="all" />
		<label>
			Cena:<br />
			<input type="text" name="1_cena_vrednost" id="1_cena_vrednost" rule="^\d+([\.,]*[\d]+)*$" />
		</label>
		<label>
			Porez:<br />
			<select name="1_porez" id="1_porez">
				{{%loop start porez_id}}
				<option value="{{$porez_id}}">{{$porez_name}}-{{$porez_perc}}</option>
				{{%loop end}}
			</select>
		</label>
		<label>
			Kampanja:<br />
			<select name="1_kampanja" id="1_kampanja">
				{{%loop start kampanja_id}}
				<option value="{{$kampanja_id}}">{{$kampanja_name}}</option>
				{{%loop end}}
			</select>
		</label>
	</fieldset>
</form>
<script>
setInputRules();
</script>